//连接数据库
const mongoose = require("mongoose");
mongoose.connect("mongodb://127.0.0.1:27017/test");
const db = mongoose.connection;
db.on("error",console.error.bind(console, 'connection error:'))
db.on("open",console.log.bind(console, 'connection success'))

